package com.lmu.travel.entity;

import org.springframework.stereotype.Component;

/**
 * @author liuxuhuang
 * @className: Result
 * @description: 前端返回对象
 * @email liuxuhuang3970@qq.com
 * @date 2021/6/27 17:42
 * @version：1.0
 */
@Component
public class Result<T> {
    private int code;
    private boolean flag;
    private Object data;
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Result() {
    }

    public Result(int code, boolean flag, Object data, String msg) {
        this.code = code;
        this.flag = flag;
        this.data = data;
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", flag=" + flag +
                ", data=" + data +
                ", msg='" + msg + '\'' +
                '}';
    }
}
